package com.i2863.receiptinterface.service.impl;

import com.i2863.receiptinterface.entity.Prize;
import com.i2863.receiptinterface.mapper.PrizeMapper;
import com.i2863.receiptinterface.service.PrizeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PrizeServiceImpl implements PrizeService {

    @Resource
    private PrizeMapper prizeMapper;

    @Override
    public Prize findOne(Integer Id) {
        return prizeMapper.selectByPrimaryKey(Id);
    }

    @Override
    public List<Prize> findAll() {
        return prizeMapper.selectAll();
    }

    @Override
    public void update(Prize prize) {
        prizeMapper.updateByPrimaryKey(prize);
    }

    @Override
    public void delete(Integer Id) {
        prizeMapper.deleteByPrimaryKey(Id);
    }

    @Override
    public void add(Prize prize) {
        prizeMapper.insert(prize);
    }
}
